<template>
    <div>
<Head :title="title"></Head>
    <div class="collect">
      <div class="goodslist" v-for="item in goods" :key="item.id">
        <div class="goodscard">
          <img :src="item.list_pic_url" alt="" />
          <p class="cardtitle">{{ item.name }}</p>
          <p class="cardprice">￥{{ item.retail_price }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { listAction } from '@/api/mine'
import Head from '@/components/title.vue'
import { ref } from 'vue'
const title = ref('我的收藏')
const goods = ref({})
listAction({
  openId: localStorage.getItem('openId')
}).then(res => {
  goods.value = res.collectGoodsList
})
</script>

<script>
export default {
  name: 'collectView'
}
</script>

<style lang="scss" scoped>
.collect {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  .goodslist {
    .goodscard {
      width: 47%;
      img {
        width: 350px;
        height: 350px;
      }
      .cardtitle {
        font-size: 26px;
        color: #333333;
        letter-spacing: 0;
        font-weight: 500;
        margin-left: 21px;
        width: 313px;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .cardprice {
        font-size: 26px;
        color: #9e4242;
        letter-spacing: 0;
        font-weight: 400;
        margin-left: 21px;
        margin-top: 5px;
      }
    }
  }
}
</style>
